import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class MeiTuan{
    public static void main(String[] args) {
        try{
            URL url = new URL("https://gamebox-fin.meituan.com/api/cardholder/api/activity/participateActivity");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setDoOutput(true);
            connection.setDoInput(true);
            connection.setRequestMethod("POST");
            connection.setUseCaches(false);
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Cookie", "token=-oVAtAYRwR1RpLsc09UXRVZVrWoAAAAARgwAAGmvPmkHSfkM0KY0leErzrRhIf4ha_mv1Kfh6GQRKh56IMWr-nvUNJwEkOeDpoQjfQ");
            connection.connect();
            DataOutputStream dataout = new DataOutputStream(connection.getOutputStream());
            String parm = "{\"cardMetaId\":\"7\",\"activityId\":\"20\",\"riskLevelMap\":{}}";
            dataout.writeBytes(parm);
            dataout.flush();
            dataout.close();
            BufferedReader bf = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
            String line;
            StringBuilder sb = new StringBuilder();
            while ((line = bf.readLine()) != null) {
                sb.append(line);
            }
            bf.close();
            connection.disconnect();
            System.out.println(sb.toString());
        }catch (Exception e) {
            e.printStackTrace();
            System.out.println("error: "+e.getMessage());
        }
    }
}